private _pos = getMarkerPos "mk_players";

//等待初始点、并等待一定段时间
waitUntil {time > 15};
waituntil
{
sleep 1;
!isNil "as_start_pos"
};


while {true} do
{
	sleep 30;
	{
		private _unit = _x;
		if ((_unit distance2D _pos < 500) || {_unit distance2D [0,0,0] < 100}) then
		{	
			//_____________________________________传送至不在这里的队友处______________________________
			private _list =  ((call fn_getPlayerRed)) select 
			{(alive _x)
			&& {_x != _unit} 
			&& {_x distance2D _pos > 500}
			&& {_x distance2D [0,0,0] > 200}
			&& {_x getVariable ['FAR_isUnconscious',1] == 0}
			};
			
			if(count _list == 0) then
			{//如果没有，则不判断倒地
				_list =  ((call fn_getPlayerRed)) select 
				{(alive _x)
				&& {_x != _unit} 
				&& {_x distance2D _pos > 500}
				&& {_x distance2D [0,0,0] > 200}
				};
			};
			
			if(count _list > 0) then
			{
				private _player_other = selectRandom _list;
				private _veh = vehicle _player_other;
				if(_veh != _player_other) then
				{
					_unit moveInAny _veh;
				}
				else
				{
					_unit setVehiclePosition [getPos _player_other, [], 0, "NONE"];
				}; 
			}
			else
			{
				_unit setVehiclePosition [as_start_pos, [], 0, "NONE"];
			};
		};
	}forEach (call fn_getPlayerRed);
};
